package com.jie.jie.rili;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.jie.jie.R;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class RiliActivity extends AppCompatActivity {


    @Bind(R.id.rv)
    RiliView rv;
    @Bind(R.id.activity_main2)
    LinearLayout activityMain2;
    @Bind(R.id.left_iv)
    ImageView leftIv;
    @Bind(R.id.tv)
    TextView tv;
    @Bind(R.id.right_iv)
    ImageView rightIv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        ButterKnife.bind(this);
        List<Long> data = new ArrayList<>();
        data.add((long) 1488360291 * 1000);
        data.add((long) 1488705891 * 1000);
        data.add((long) 1488446691 * 1000);
        data.add((long) (1491339905 * 1000));
        data.add((long) (1492290305 * 1000));
        data.add((long) (1495055105 * 1000));
        rv.setAllReturnTime(data);
//        rv.setReturntime((ArrayList<Long>) data);
        tv.setText(rv.getYearAndmonth());
    }

    @OnClick({R.id.left_iv, R.id.tv, R.id.right_iv})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.left_iv:
                rv.clickLeftMonth();
                tv.setText(rv.getYearAndmonth());

                break;
            case R.id.tv:
                break;
            case R.id.right_iv:
                rv.clickRightMonth();
                tv.setText(rv.getYearAndmonth());
                break;
        }
    }
}
